/*
 * @Copyright: Copyright (c) 2030 吴周海
 * @Author: wzh200x@126.com
 * @Date: 2025-10-09 14:49:23
 * @LastEditors: wzh200x@126.com
 * @LastEditTime: 2025-10-10 17:13:14
 * @FilePath: \goWebServer\goGameWebServer\internal\register\registerInit\registerInit.go
 * @Description: 文件功能描述
 */
package registerinit

import (
	"goGameWebServer/internal/common/database"
	"goGameWebServer/internal/defines/entityName"
	"goGameWebServer/internal/model/entity"
	"goGameWebServer/internal/register"
)

func init() {
	initDatabase()
	initModel()
}

// func initProMiddleware() {
// 	// 注册web中间件前置
// 	register2.RegisterLocalPreMiddleware(middlewares.MiddlewareCORS)
// 	// 注册web中间件后置
// 	register2.RegisterLocalPostMiddleware(middlewares.MiddlewareLogger)
// }

func initDatabase() {
	// 注册数据库
	register.RegisterDatabase("mysql", database.NewMysqlDatabase)
}

func initModel() {
	// 注册实体数据模型
	register.RegisterModel(entityName.EntityName_Account, entity.NewAccountModel)

	register.RegisterModel(entityName.EntityName_Server, entity.NewServerModel)
	register.RegisterModel(entityName.EntityName_Subscribe, entity.NewSubscribeModel)
	register.RegisterModel(entityName.EntityName_KuaiShouReport, entity.NewKuaiShouReportModel)
	register.RegisterModel(entityName.EntityName_GameConfig, entity.NewGameConfigModel)
	register.RegisterModel(entityName.EntityName_Center, entity.NewCenterModel)
	register.RegisterModel(entityName.EntityName_CdKeyUse, entity.NewCdKeyUseModel)
	register.RegisterModel(entityName.EntityName_CdKey, entity.NewCdKeyModel)
	register.RegisterModel(entityName.EntityName_CdKeyGroup, entity.NewCdKeyGroupModel)
	register.RegisterModel(entityName.EntityName_ByteJumpReport, entity.NewByteJumpReportModel)
	register.RegisterModel(entityName.EntityName_AvatarModuleEntity, entity.NewAvatarModuleEntityModel)
	register.RegisterModel(entityName.EntityName_Avatar, entity.NewAvatarModel)
	register.RegisterModel(entityName.EntityName_AlipayReport, entity.NewAlipayReportModel)
}
